calculate probability from a table